<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-on修饰符</title>
</head>
<body>
    <div id="app">
        <div @click="divClick()">
            按钮
            <button @click.stop="btnClick()">按钮</button>
        </div>
        <form action="send">
            <input type="submit" value="提交" @click.prevent="submitClick">
        </form>

<!--        监听某个按键的点击-->
        <input type="text" @keyup.enter="keyUp">

        <button @click.once="btnClick2">按钮2</button>
    </div>
</body>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
              counter: 0,
            },
            methods: {
                divClick() {
                    console.log('divClick');
                },
                btnClick() {
                    console.log('btnClick');
                },
                submitClick() {
                    console.log('submit提交');
                },
                keyUp() {
                    console.log('keyUp');
                },
                btnClick2() {
                    console.log('btnClick2');
                },
            }
        })
    </script>
</html>